Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

121
Vistas
What does [[Scopes]] mean in prototype?

I'm studying prototype and doing some testing, and I've decided to assign a method to the String object like this:

String.prototype.sel = function sel() {
    var elem = doc.querySelectorAll(this);
    if (elem.length == 1)
        return elem[0];

    return elem;
}

And when getting a console.log(String.prototype) and getting the method I created, I noticed that in [[Scopes]] I get 1: Global {window: Window..., what does [[Scopes]] mean?

Complete test:

String.prototype.sel = function sel() {
    var elem = document.querySelectorAll(this);
    if (elem.length == 1)
        return elem[0];

    return elem;
}

'[btnSend]'.sel().onclick = () => {
    alert('ok')
}

console.log(String.prototype);
<button btnSend>Send</button>

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda